<? if(!defined('IN_DISCUZ')) exit('Access Denied'); ?>
<input type="hidden" name="polls" value="yes" />
<div class="specialpost s_clear">
<p><em>选项:</em>每行填写 1 个选项 最多可填写 <?=$maxpolloptions?> 个选项</p>
<div class="specialinfo sppoll">
<? if($action == 'newthread') { ?>
<span id="polloption_new"></span>
<p id="polloption_hidden" style="display: none"><input name="polloption[]" class="optioninfo txt" tabindex="1" /><a href="javascript:;" class="deloption" title="del" onclick="this.parentNode.parentNode.removeChild(this.parentNode)">del</a></p>
<p><a href="javascript:;" onclick="addpolloption()">+增加一项</a></p>
<? } else { if(is_array($poll['polloption'])) { foreach($poll['polloption'] as $key => $option) { ?><p>
<input type="hidden" name="polloptionid[<?=$poll['polloptionid'][$key]?>]" value="<?=$poll['polloptionid'][$key]?>" />
<input name="displayorder[<?=$poll['polloptionid'][$key]?>]" type="text" class="optionnum txt" tabindex="1" value="<?=$poll['displayorder'][$key]?>" />
<input name="polloption[<?=$poll['polloptionid'][$key]?>]" type="text" class="optioninfo txt" tabindex="1" value="<?=$option?>"<? if(!$alloweditpoll) { ?> readonly<? } ?> />
</p><? } } ?><span id="polloption_new"></span>
<p id="polloption_hidden" style="display: none"><input name="displayorder[]" type="text" class="optionnum txt" tabindex="1" /><input name="polloption[]" class="optioninfo txt" tabindex="1" /><a href="javascript:;" class="deloption" title="del" onclick="this.parentNode.parentNode.removeChild(this.parentNode)">del</a></p>
<p><a href="javascript:;" onclick="addpolloption()">+增加一项</a></p>
<? } ?>
</div>
<div class="specialaddons">
<p><label for="pollnum"><input name="multiplepoll" type="checkbox" value="1"<? if($poll['multiple']) { ?> checked<? } ?> tabindex="1" />多选投票</label> <input name="maxchoices" class="spshortinput txt" value="<?=$poll['maxchoices']?>" type="text" tabindex="1" /></p>
<p><label for="polldatas"><input name="expirationchecked" type="checkbox" value="1" tabindex="1" />记票天数</label> <input id="polldatas" name="expiration" class="spshortinput txt" type="text" value="<? if(!$poll['expiration']) { ?>0<? } elseif($poll['expiration'] < 0) { ?>关闭投票<? } elseif($poll['expiration'] < $timestamp) { ?>已结束<? } else { print_r(round(($poll['expiration'] - $timestamp) / 86400)) ?> <? } ?>" tabindex="1" /></p>
<p><input name="visibilitypoll" type="checkbox" value="1"<? if($action == 'edit' && !$poll['visible']) { ?> checked<? } ?> tabindex="1" />投票后结果可见</p>
<p><input name="overt" type="checkbox" value="1"<? if($action == 'edit' && $poll['overt']) { ?> checked<? } ?> tabindex="1" />公开投票参与人</p>
</div>
</div>
</div>
</div>

<script type="text/javascript" reload="1">
function addpolloption() {
$('polloption_new').outerHTML = '<p>' + $('polloption_hidden').innerHTML + '</p>' + $('polloption_new').outerHTML
}
<? if($action == 'newthread') { ?>
addpolloption();
addpolloption();
addpolloption();
addpolloption();
addpolloption();
<? } ?>
</script>